<extend name="Public/base"/>

<block name="body">
  <div class="main-title">
    <h2>{:isset($data['id'])?'编辑':'新增'}配送地区</h2>
  </div>
  <form action="{:U('update')}" method="post" class="form-horizontal">
    <div class="form-item">
      <label class="item-label">所属区域<span class="check-tips">（供商户添加运费模板做选择）</span></label>
      <div class="controls">
        <select name="zone_id">
            <option value="0">请选择</option>
            <volist name="zone" id="vo">
              <option value="{$vo.id}">{$vo.name}</option>
            </volist>
        </select>
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">上级地区<span class="check-tips">（所属的上级地区）</span></label>
      <div class="controls">
        <select name="pid">
          <if condition="max(I('pid'), $data['pid']) gt 0">
            <option value="{$data_up.id}">{$data_up.title}</option>
          <else />
            <option value="0">顶级地区</option>
          </if>   
        </select>
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">名称<span class="check-tips"></span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="title" value="{$data.title|default=''}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">地区简称<span class="check-tips">（比如：北京市的简称为北京）</span></label>
      <div class="controls">
        <input type="text" class="text input-large" name="sub_name" value="{$data.sub_name|default=''}">
      </div>
    </div>
    <div class="form-item">
      <label class="item-label">排序<span class="check-tips"></span></label>
      <div class="controls">
        <input type="text" class="text input-small" name="sort" value="{$data.sort|default=0}">
      </div>
    </div>
    <div class="form-item">
      <input type="hidden" name="id" value="{$data.id|default=''}">
      <button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
      <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>
    </div>
  </form>
</block>

<block name="script">
  <script type="text/javascript">
    //导航高亮
    highlight_subnav('{:U('index')}');
    Core.setValue("zone_id", {$data.zone_id|default = 0});
  </script>
</block>